﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        var obj = {
            name: "lili",
            age: 18,
        }

        // 对象的展开
        var obj1 = {
            ...obj,
            phone: 37827382
        }
        // console.log(obj1);
        //深复值

        var a = 10;

        var obj2 = {
            a,   //a:a,   // 属性名:变量名, 当属性名和变量名一样的时候,可以简写一个属性名
            name: "obj2",
            run: function () {
                console.log("run", this); //obj2
            },
            run1() {  //函数的简写
                console.log("run1111", this); //obj2
            },
            age: 18,
        }
        console.log(obj2.a);

        obj2.run();
        obj2.run1();
    </script>
</body>
</html>